package org.geoscrape;

/**
 *
 */
public enum CacheSize
{
	NANO, MICRO, SMALL, REGULAR, LARGE, UKNOWN, OTHER, VIRTUAL,NOT_CHOSEN;
	
	public static CacheSize parse(String name)
	{
		name = name.toUpperCase();
		name = name.replaceAll(" ","_");
		return CacheSize.valueOf(name);
	}
	
	@Override
	public String toString()
	{
		//get the name
		String name = super.toString();
		//convert to lowercase
		name = name.toLowerCase();
		//change underscore to space
		name = name.replaceAll("_", " ");
		//capitalise first letter
		String firstLetter = name.substring(0,1).toUpperCase();
		String rest = name.substring(1);
		return firstLetter+rest;
		
	}
}
